package com.example.iotlink.bean;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.influxdb.annotation.Column;
import org.influxdb.annotation.Measurement;
import plus.ojbk.influxdb.annotation.Count;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 传感器-实时数据
 */
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
@Measurement(name = "ojbk")
public class TestData {

    @Column(name = "pid", tag = true)
    private String pid;

    @Column(name = "sign", tag = true)
    private String sign;

    // Column中的name为measurement中的列名
    // 此外,需要注意InfluxDB中时间戳均是以UTC时保存,在保存以及提取过程中需要注意时区转换
    @Column(name = "time")
    private LocalDateTime time;



    @Count("value")
    @Column(name = "value")
    private Float  value;


}
